//
//  UITabBarItem+UIButton.swift
//  小陈微博Swift用纯代码创建
//
//  Created by 小陈 on 16/3/1.
//  Copyright © 2016年 小陈. All rights reserved.
//

import UIKit

// 扩展 UIBarButttonItem 方便包装带按钮的 UIBarButtonItem
extension UIBarButtonItem {
    
    
    convenience init(ImageName: String) {
        
      let button = UIButton()

        
        button.setImage(UIImage(named: ImageName), forState: UIControlState.Normal)
        button.setImage(UIImage(named: ImageName + "_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        

        self.init(customView: button)


   }
    
}